# Contributor: Carlos Giraldo <cgiraldo@gradiant.org>
# Maintainer: Carlos Giraldo <cgiraldo@gradiant.org>
pkgname=py3-scikit-learn
pkgver=1.3.2
pkgrel=0
pkgdesc="a Python module for machine learning built on top of SciPy"
url="https://scikit-learn.org/"
arch="all"
license="BSD-3-Clause"
options="!check" # no test suite
depends="
	py3-joblib
	py3-numpy
	py3-scipy
	py3-threadpoolctl
	python3
	"
makedepends="
	cython
	py3-gpep517
	py3-numpy-dev
	py3-setuptools
	py3-wheel
	python3-dev
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/s/scikit-learn/scikit-learn-$pkgver.tar.gz"
builddir="$srcdir/scikit-learn-$pkgver"

case "$CARCH" in
aarch64)
	export SKLEARN_NO_OPENMP=1
	;;
esac

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto" \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	find "$pkgdir" -type d -name "tests" -exec rm -rf {} \+
}

sha512sums="
fa48267c3e1784c52a72c40bb0bc6e39fcd9b7d9a80b889d0fa02153c6473a79fe4e51266d56b504bf01179d8a5af4216b29d9008a532afbe133e7eac79cd336  scikit-learn-1.3.2.tar.gz
"
